package com.ruoyi.common.enums;

import com.ruoyi.common.utils.StringUtils;

/**
 * OA是否码值枚举类
 *
 * @author yinjc
 */
public enum OAYesNoEnum {

    Yes("6772411904715606105", "是")
    , NO("-2481647813983188338", "否")
    ;

    OAYesNoEnum(String oaYesNo, String oaYesNoName) {
        this.oaYesNo = oaYesNo;
        this.oaYesNoName = oaYesNoName;
    }

    private final String oaYesNo;
    private final String oaYesNoName;

    public String getOaYesNo() {
        return oaYesNo;
    }

    public String getOaYesNoName() {
        return oaYesNoName;
    }

    public static String getOaYesNoName(String oaYesNo) {
        for (OAYesNoEnum oaYesNoEnum : values()) {
            if (StringUtils.equals(oaYesNo, oaYesNoEnum.getOaYesNo())) {
                return oaYesNoEnum.getOaYesNoName();
            }
        }
        return null;
    }
}
